package com.zzt.book.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description
 * User: panda
 * Date: 2025-03-28
 * Time: 16:50
 */
@RequestMapping("/test")
@RestController
public class TestController {
    @RequestMapping("/t1")
    public Integer t1(){
        int a = 10 / 0;    //除数不能为0
        return 1;
    }

    @RequestMapping("/t2")
    public Boolean t2(){
        int[] a = {1,2,3};
        System.out.println(a[4]);   //数组越界异常
        return true;
    }

    @RequestMapping("/t3")
    public String t3(){
        String a = null;
        System.out.println(a.length()); //空指针异常
        return "t3";
    }
}
